<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>施工场景危险源识别系统架构</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 60vh;
            margin: 0;
            background-color: #f5f5f5;
        }

        .diagram {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;
        }

        .layer {
            width: 200px;
            /* height: 300px; */
            padding: 15px;
            margin: 0 5px;
            border-radius: 10px;
            text-align: center;
            color: white;
            position: relative;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .data {
            background-color: #FF9800;
        }

        .processing {
            background-color: #2196F3;
        }

        .application {
            background-color: #4CAF50;
        }
        .application1 {
            background-color: pink;
        }
        .application2 {
            background-color: skyblue;
        }

        .arrow {
            width: 0;
            height: 0;
            border-top: 15px solid transparent;
            border-bottom: 15px solid transparent;
            margin: 0 5px;
        }

        .arrow-right {
            border-left: 15px solid #2196F3;
        }

        .arrow-left {
            border-right: 15px solid #FF9800;
        }

        h1 {
            position: absolute;
            top: 20px;
            width: 100%;
            text-align: center;
            color: #333;
        }

        .components {
            text-align: left;
            background-color: rgba(255, 255, 255, 0.2);
            padding: 10px;
            border-radius: 5px;
            margin-top: 10px;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .layer-title {
            font-weight: bold;
            font-size: 18px;
            margin-bottom: 10px;
        }
    </style>
</head>

<body>
    <h1>0层数据流</h1>

    <div class="diagram">
        <div class="layer data">
            <div class="layer-title">安全检察员</div>
        </div>
拍照
        <div class="arrow arrow-right"></div>

        <div class="layer processing">
            <div class="layer-title">手机检测</div>
        </div>
上传
        <div class="arrow arrow-right"></div>

        <div class="layer application">
            <div class="layer-title">服务器保存</div>
        </div>
        
    </div>

    <script>
        // Add animation to the layers
        document.addEventListener('DOMContentLoaded', function () {
            const layers = document.querySelectorAll('.layer');
            const arrows = document.querySelectorAll('.arrow');

            layers.forEach((layer, index) => {
                // Initial state
                layer.style.opacity = '0';
                layer.style.transform = 'translateX(' + (index % 2 === 0 ? '-' : '') + '20px)';

                // Animate after a delay
                setTimeout(() => {
                    layer.style.transition = 'opacity 0.5s ease, transform 0.5s ease';
                    layer.style.opacity = '1';
                    layer.style.transform = 'translateX(0)';
                }, index * 300);
            });

            arrows.forEach((arrow, index) => {
                // Initial state
                arrow.style.opacity = '0';

                // Animate after a delay
                setTimeout(() => {
                    arrow.style.transition = 'opacity 0.5s ease';
                    arrow.style.opacity = '1';
                }, (index + 1) * 300);
            });

            // Add hover effects
            layers.forEach(layer => {
                layer.addEventListener('mouseover', function () {
                    this.style.transform = 'scale(1.05)';
                    this.style.transition = 'transform 0.2s ease';
                    this.style.zIndex = '10';
                });

                layer.addEventListener('mouseout', function () {
                    this.style.transform = 'scale(1)';
                    this.style.zIndex = '1';
                });
            });
        });
    </script>
</body>

</html>